var demo1 = xmSelect.render({
	el: '#demo1', 
	data: [
		{name: '张三', value: 1},
		{name: '李四', value: 2},
		{name: '王五', value: 3},
	]
})
	function cancl(){
		var index = parent.layer.getFrameIndex(window.name); //获取当前窗口的name
		parent.layer.close(index); //关闭窗口
	}
	function texLength(obj, maxlength, id) {
		var curr = obj.value.length;
		if (curr > maxlength) {
			layer.msg('字数在' + maxlength + '字以内');
		} else {
			document.getElementById(id).innerHTML = curr;
		}
	}
	layui.use(['form', 'layedit', 'laydate'], function() {
		var form = layui.form,
			layer = layui.layer,
			layedit = layui.layedit,
			laydate = layui.laydate;
		//监听提交
		form.on('submit(demo1)', function(data) {
			layer.alert(JSON.stringify(data.field), {
				title: '最终的提交信息',
				time: 2000, //2s后自动关闭
			})
			setInterval(function() {
				var index = parent.layer.getFrameIndex(window.name); //获取当前窗口的name
				parent.layer.close(index); //关闭窗口
			}, 3000)

			return false;
		});

	});